//
//  CFavoriteCtrlPage.m
//  HCHK_iphone
//
//  Created by yilong zhang on 11-12-19.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "CFavoriteCtrlPage.h"

@implementation CFavoriteCtrlPage

static CFavoriteCtrlPage *g_Instance = nil;

@synthesize m_TopbarView;

+(id)allocWithZone:(NSZone *)zone
{
    @synchronized(self)
    {
        if (!g_Instance)
        {
            g_Instance = [super allocWithZone:zone];
        }
    }
    
    return g_Instance;
}

+(CFavoriteCtrlPage*)DefaultFavoritePage
{
    if (!g_Instance)
    {
        g_Instance = [[CFavoriteCtrlPage alloc] init];
    }
    
    return g_Instance;
}

+(void)DestroyFavoritePage
{
    if (g_Instance)
    {
        [g_Instance release];
    }
    
    g_Instance = nil;
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    m_TopbarView = [[CTopBarView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, TOPBAR_HEIGHT)];
    [self.view addSubview:m_TopbarView];
    [m_TopbarView release];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
